home *** CD-ROM | disk | FTP | other *** search
- property pDragging, startH, startV, startRect, thisWindow, lastMouseH, lastMouseV
-
- on mouseDown
- global gPauseState, gDragRect
- if paused() then
- alertBeep()
- exit
- end if
- pDragging = 1
- startH = (the clickLoc)[1]
- startV = (the clickLoc)[2]
- thisWindow = the activeWindow
- startRect = thisWindow.rect
- end
-
- on exitFrame
- lastMouseH = the mouseH
- lastMouseV = the mouseV
- if paused() then
- pDragging = 0
- exit
- end if
- if pDragging then
- if the stillDown then
- newRect = offset(startRect, the mouseH - startH, the mouseV - startV)
- if thisWindow <> the stage then
- tell the stage
- checkElapsedTime()
- move_dummy(thisWindow, newRect)
- end tell
- end if
- lastMouseH = the mouseH
- lastMouseV = the mouseV
- else
- newRect = offset(startRect, lastMouseH - startH, lastMouseV - startV)
- if thisWindow <> the stage then
- tell the stage
- drop_window(thisWindow, newRect)
- end tell
- end if
- pDragging = 0
- end if
- end if
- end
-
- on stopDragging me
- pDragging = 0
- end
-